package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class SysRoleFunction implements Serializable {

	private static final long serialVersionUID = -8630297827528944025L;

	//fields
	private java.lang.Integer roleId;
	private java.lang.Integer functionId;

	//default constructor
	public SysRoleFunction() {
	}

	//constructor with arguments
	public SysRoleFunction(java.lang.Integer functionId, java.lang.Integer roleId) {
		this.functionId = functionId;
		this.roleId = roleId;
	}

	//getter
	public java.lang.Integer getRoleId() {
		return roleId;
	}
	public java.lang.Integer getFunctionId() {
		return functionId;
	}

	//setter
	public void setRoleId(java.lang.Integer roleId) {
		this.roleId = roleId;
	}
	public void setFunctionId(java.lang.Integer functionId) {
		this.functionId = functionId;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof SysRoleFunction))
			return false;

		final SysRoleFunction sysRoleFunction = (SysRoleFunction)other;
		if (!this.functionId.equals(sysRoleFunction.getFunctionId()) || 
			!this.roleId.equals(sysRoleFunction.getRoleId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(functionId).append(",");
		keys.append(roleId).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("SysRoleFunction[")
			.append("roleId=").append(roleId).append(", ")
			.append("functionId=").append(functionId).append("]").toString();
	}
}